package com.itheima.properties;

import java.util.Map;
import java.util.Properties;
import java.util.Set;

/*
把 Properties 当做map  使用

增删 改查  遍历
 */
public class Demo01 {

    public static void main(String[] args) {
        Properties properties = new Properties();
        properties.put("马蓉","宋喆");
        properties.put("小璐","PGone");
        properties.put("都美竹","吴亦凡");
        System.out.println(properties);
        properties.remove("都美竹");
        System.out.println(properties);
        properties.put("小璐","亮亮");
        System.out.println(properties);

        System.out.println(properties.getProperty("马蓉"));

        Set<Object> keys = properties.keySet();
        for (Object key : keys) {
            System.out.println(key+"===="+properties.get(key));

        }
        System.out.println("--------------------");
        Set<Map.Entry<Object, Object>> entries = properties.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey()+"%%%%%"+entry.getValue());

        }
        System.out.println("--------------------");
        properties.forEach((k,v)->{
            System.out.println(k+"@@@@@"+v);
        });



    }
}
